package com.tjsinfo.tjsoa.useseal.bo;

import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;

import com.tjsinfo.tjsoa.Dao.IQbcDao;
import com.tjsinfo.tjsoa.useseal.dao.ITUseSealSealFileDAO;
import com.tjsinfo.tjsoa.useseal.vo.TUseSealSealFile;
import com.tjsinfo.tjsoa.useseal.vo.TUseSealSealOpe;

public class TUseSealSealFileBO implements ITUseSealSealFileBO {
	private IQbcDao qbcDao;
	private ITUseSealSealFileDAO sealFileDao;
	
	public void setQbcDao(IQbcDao qbcDao) {
		this.qbcDao = qbcDao;
	}

	public void setSealFileDao(ITUseSealSealFileDAO sealFileDao) {
		this.sealFileDao = sealFileDao;
	}

	public void deleteA(String sealId) {
		// TODO Auto-generated method stub
		sealFileDao.deleteA(sealId);
	}

	public TUseSealSealFile findById(String id) {
		// TODO Auto-generated method stub
		return sealFileDao.findById(id);
	}

	public void save(TUseSealSealFile transientInstance) {
		// TODO Auto-generated method stub
		sealFileDao.save(transientInstance);
	}

	public List<TUseSealSealFile> selectSealId(String sealId) {
		// TODO Auto-generated method stub
		DetachedCriteria detachedCriteria = DetachedCriteria.forClass(TUseSealSealFile.class);
		detachedCriteria.add(Restrictions.eq("sealId", sealId));
		detachedCriteria.addOrder(Order.desc("id"));
		return qbcDao.getCriteria(detachedCriteria);
	}	
}
